﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DHAA.Areas.Administrator.Models.CustomerModels>" %>

   <% using (Ajax.BeginForm("Create", "Customer" ,new AjaxOptions { UpdateTargetId = "fancybox-content", LoadingElementId = "loadingIcon", OnBegin = "MvcFormOnBegin", OnSuccess = "MvcFormOnSuccess", OnComplete = "MvcFormOnComplete", OnFailure = "MvcFormOnFailure" }))
      {
   %>
        <%= Html.ValidationSummary(true) %>

        <fieldset style="width: 640px">
            <legend>Create New Customer</legend>
                       <div class="Message Error"><%= ViewData["MessageError"] %></div>
        <div class="Message Success"><%= ViewData["MessageSuccess"] %></div>
            <div class="editor-label">
                <%= Html.LabelFor(model => model.UserName) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.UserName) %>
                <%= Html.ValidationMessageFor(model => model.UserName) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.Password) %>
            </div>
            <div class="editor-field">
                <%= Html.PasswordFor(model => model.Password) %>
                <%= Html.ValidationMessageFor(model => model.Password) %>
            </div>

            <div class="editor-label">
                <%= Html.LabelFor(model => model.ConfirmPassword) %>
            </div>
            <div class="editor-field">
                <%= Html.PasswordFor(model => model.ConfirmPassword) %>
                <%= Html.ValidationMessageFor(model => model.ConfirmPassword) %>
            </div>

            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.CustomerName) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.CustomerName) %>
                <%= Html.ValidationMessageFor(model => model.CustomerName) %>
            </div>
            <div class="cleared-top-5"></div>
            <div>
                <input type="submit" value="Create" /><div id="loadingIcon"></div><input type="button" onclick="$.fancybox.close()" value="Cancel"/>
            </div>
            <div class="cleared"></div>
        </fieldset>

    <% } %>

    

